define(function(require, exports, module) {
    var $ = require("jquery");
    /**
     * 重新计算菜单区高度
     */
    exports.sidebar = function () {
        var windowHeight = window.getHeight();
        //菜单高度
        var sidebarHeight = windowHeight- 30;
        $(".wrapper .main-sidebar").css("height",sidebarHeight);
        $(".wrapper .main-sidebar").css("min-height",sidebarHeight);
    }

    /**
     * 重新计算路由区高度
     * @param headerHeight 头部高度
     * @param footerHeight 底部高度
     */
    exports.router = function (	headerHeight , footerHeight) {
        var windowHeight = window.getHeight();
        //头部工具
        var headerHeight = 0 ;
        if($(".wrapper .main-header").length > 0){
            headerHeight = $(".main-header").height();
        }
        //位置栏高度
        var locationHeight = 0 ;
        if($(".wrapper .content-wrapper .page-content-location").length > 0){
            locationHeight = $(".wrapper .content-wrapper .page-content-location").height();
        }
        //底部高度
        /*var footerHeight = 0 ;
        if($(".main-footer").length > 0){
            footerHeight = $(".main-footer").height();
        }*/
        //内容区域高度
        var contentHeight = windowHeight - headerHeight - locationHeight - 40;
        //最小高度
        if(contentHeight < 500){
            contentHeight = 500;
        }
        $(".wrapper .content-wrapper .content-container-wrapper .page-content-wrapper").css("height" , contentHeight);
    };

    /**
     * 计算内容区高度
     * @returns {number}
     */
    exports.contentWrapperHeight = function(){
        var height = $(".wrapper .content-wrapper .content-container-wrapper").height();
        //位置栏高度
        var locationHeight = 0 ;
        if($(".wrapper .content-wrapper .page-content-location").length > 0){
            locationHeight = $(".wrapper .content-wrapper .page-content-location").height();
        }
        return height - locationHeight - 30;
    }
});
